pp108 : updateAllowed Property

updateAllowed Property

Optional property that defines whether the item descriptions displayed in the tree nodes are editable or not.

Syntax

XML

<script type="cordys/xml" id=treeSchemaID>
    <TreeSchema>
        <searchPath>sXPath<searchPath>
        <updateAllowed>bAllow</updateAllowed>
        <description></description>
        ...
        ...
        <TreeItem>
            <searchPath>sName<searchPath>
            <updateAllowed>bAllow</updateAllowed>
            <description></description>
            ...
            ...
            ...
        </TreeItem>
    </TreeSchema>
</script>

Note:
The description property is mandatory while using the updateAllowed property.

Parameters

Parameter

Description

bAllow

Boolean that denotes whether updating the descriptions of the tree nodes is allowed or not.

  • true: Allowed to update.
  • false: Default. Not allowed to update.

Remarks

Once the property is set in the treeSchema, the description for a node in the tree can be changed by selecting the item and clicking on the selected item again. By doing so, a textbox will appear in the place of the tree node description, where the users can type-in the new description. Once the description is typed, it can be set to the tree by the following actions.

  • Pressing the Enter key.
  • Selecting another node.
  • Using tab to switch to the next node.

However, the data of the item for which the change is made will always point to the old description. It is the responsibility of the users to manually change the treeData of the item.

Example

The following example demonstrates the usage of the property.

<!-- Schema for tree -->
<script type="cordys/xml"  id="schema">
    <TreeSchema>
        <searchPath>//data/tuple/old/</searchPath>
        <updateAllowed>true</updateAllowed>
        <Root>
            <description>Employees</description>
        </Root>
        <TreeItem id="EmployeesID">
            <searchPath>Employees</searchPath>
            <description>FirstName</description>
            <updateAllowed>false</updateAllowed>
        </TreeItem>
    </TreeSchema>
</script>
<!-- tree definition - data denotes the data to be displayed in the tree -->
<div cordysType="wcp.library.ui.Tree" id="sampleTree" treeSchema="schema" treeData="data">
</div>

See Also

tree, onchange